Hello everybody, I have an interface with several list, button, textbox, etc... I create and place my box, for each running of my dxl script. So, at the starting I create my interface, but when I have tried to add a new one during a script execution, nothing is displayed. My objectif is : When I click on a button, I would like add a radiobox or a checkbox. I have created them but no dialog box have appeared on my interface. Do you have a solution for that, do you know if a command exists to refresh my interface in order to see my new dialog box ?
Thank you in advance for your help. Best Regards, Adrien andrad - Mon Jan 12 05:21:22 EST 2015 |
Re: Update my interface Hello Adrien, I dont't think that this is possible in the way you describe it. As soon as the dialog is "realize"d, you cannot add more DBEs or change existing DBEs (like changing the text on a button). But you can use "hide" / "show" in your dialog. So, paint all DBEs on your form and "hide" those that normally should not be seen. Then, when the user clicks on a button, "show" the radiobox. You can even paint DBEs on the same spot in the dialog, just make sure that these are not 'show"n at the same time.
Best regards, |
Re: Update my interface Mike.Scharnow - Mon Jan 12 05:33:41 EST 2015 Hello Adrien, I dont't think that this is possible in the way you describe it. As soon as the dialog is "realize"d, you cannot add more DBEs or change existing DBEs (like changing the text on a button). But you can use "hide" / "show" in your dialog. So, paint all DBEs on your form and "hide" those that normally should not be seen. Then, when the user clicks on a button, "show" the radiobox. You can even paint DBEs on the same spot in the dialog, just make sure that these are not 'show"n at the same time.
Best regards, Hello Mike, Thank for your fast answer. Is it possible to create a new window which gets some attributes name. Each attributes have a Type and each type correspond to a dialog box type (mainly checkbox and radiobox). If I decide to display a new window with several checkbox and radiobox (and a button to set all objects). Do you know if I can try that way ?
Best Regards, Adrien |
Re: Update my interface andrad - Mon Jan 12 06:15:29 EST 2015 Hello Mike, Thank for your fast answer. Is it possible to create a new window which gets some attributes name. Each attributes have a Type and each type correspond to a dialog box type (mainly checkbox and radiobox). If I decide to display a new window with several checkbox and radiobox (and a button to set all objects). Do you know if I can try that way ?
Best Regards, Adrien I'm not really sure if I understood the question. It is possible to stack dialogs on one another. Something like this:
DBE dbeChoices = null DBE
void showSubDiag(string sWhatToDisplay, DB DBParentDialog) {
string arChoices [] = {"choice a", "choice b"}
DB mySubDialog = create (DBParentDialog, "2nd dialog", styleCentered)
if ("Check" == sWhatToDisplay) {
dbeChoices = checkBox (mySubDialog, "mylabel", arChoices, 0)
} else {
dbeChoices = radioBox (mySubDialog, "mylabel", arChoices, 0)
}
}
void btShowCheckboxes(DBE theButton){
showSubDiag("Check", getParent theButton)
}
void btShowRadio(DBE theButton){
showSubDiag("Radio", getParent theButton)
}
void showMainDiag() {
DB myMainDialog = create("this is my dialog")
DBE butCheckbox = button(editDiag, "Show Checkboxes", btShowCheckboxes)
DBE butRadio = button(editDiag, "Show Radiobuttons", btShowRadio)
}
Note that I did not test this code, there might be syntax errors
Edit: and yes, the call of showMainDiag and realize and block and destroy and ... are also missing, but you should get the idea. |
Re: Update my interface Mike.Scharnow - Mon Jan 12 07:15:08 EST 2015 I'm not really sure if I understood the question. It is possible to stack dialogs on one another. Something like this:
DBE dbeChoices = null DBE
void showSubDiag(string sWhatToDisplay, DB DBParentDialog) {
string arChoices [] = {"choice a", "choice b"}
DB mySubDialog = create (DBParentDialog, "2nd dialog", styleCentered)
if ("Check" == sWhatToDisplay) {
dbeChoices = checkBox (mySubDialog, "mylabel", arChoices, 0)
} else {
dbeChoices = radioBox (mySubDialog, "mylabel", arChoices, 0)
}
}
void btShowCheckboxes(DBE theButton){
showSubDiag("Check", getParent theButton)
}
void btShowRadio(DBE theButton){
showSubDiag("Radio", getParent theButton)
}
void showMainDiag() {
DB myMainDialog = create("this is my dialog")
DBE butCheckbox = button(editDiag, "Show Checkboxes", btShowCheckboxes)
DBE butRadio = button(editDiag, "Show Radiobuttons", btShowRadio)
}
Note that I did not test this code, there might be syntax errors
Edit: and yes, the call of showMainDiag and realize and block and destroy and ... are also missing, but you should get the idea. Hi Mike,
Your answer helped me yesterday, but I have an other issue today, I put my code below, it will be easier to explain you my second issue.
void Run_MultipleAttributes (string sListOfAttributes[], int iNoOfAttributes, DB ParentDialog)
{
DB Set_MultipleAttributes_Window = create(ParentDialog, "Set Attributes")
DBE Button_Set_All
Module m = current
void Set_All_Functions (DB Run)
{
//I want to use sListOfAttributes and iNoOfAttributes here !
}
apply(Set_MultipleAttributes_Window,"Set All Attributes",Set_All_Functions)
realize(Set_MultipleAttributes_Window,200,10)
show Set_MultipleAttributes_Window
}
You can see the main function which create my second dialog box. Inside there is an other function. I would like to use sListOfAttribute and iNoOfAttribute inside on the Set_All_Functions, but it doesn't work... And I tried several things but nothing work... Thanks for your help in advance.
Best Regards, Adrien |
Re: Update my interface andrad - Tue Jan 13 03:30:53 EST 2015 Hi Mike,
Your answer helped me yesterday, but I have an other issue today, I put my code below, it will be easier to explain you my second issue.
void Run_MultipleAttributes (string sListOfAttributes[], int iNoOfAttributes, DB ParentDialog)
{
DB Set_MultipleAttributes_Window = create(ParentDialog, "Set Attributes")
DBE Button_Set_All
Module m = current
void Set_All_Functions (DB Run)
{
//I want to use sListOfAttributes and iNoOfAttributes here !
}
apply(Set_MultipleAttributes_Window,"Set All Attributes",Set_All_Functions)
realize(Set_MultipleAttributes_Window,200,10)
show Set_MultipleAttributes_Window
}
You can see the main function which create my second dialog box. Inside there is an other function. I would like to use sListOfAttribute and iNoOfAttribute inside on the Set_All_Functions, but it doesn't work... And I tried several things but nothing work... Thanks for your help in advance.
Best Regards, Adrien Hello Adrien, I had this problem before, but currently cannot remember the technical explanation for this. Perhaps it is the same problem as e.g. in perl, see http://apache.perl.org/docs/general/perl_reference/perl_reference.html#my____Scoped_Variable_in_Nested_Subroutines The solution would here be to use global variables. Not great but it works if you have a good naming convention
Best regards, P.S: For new problems you should open a new topic, so that this discussion does not go by unnoticed for all the other forum members |
Re: Update my interface Mike.Scharnow - Tue Jan 13 04:34:54 EST 2015 Hello Adrien, I had this problem before, but currently cannot remember the technical explanation for this. Perhaps it is the same problem as e.g. in perl, see http://apache.perl.org/docs/general/perl_reference/perl_reference.html#my____Scoped_Variable_in_Nested_Subroutines The solution would here be to use global variables. Not great but it works if you have a good naming convention
Best regards, P.S: For new problems you should open a new topic, so that this discussion does not go by unnoticed for all the other forum members Thanks a lot for your help Mike, because it works perfectly now. |
Re: Update my interface andrad - Tue Jan 13 03:30:53 EST 2015 Hi Mike,
Your answer helped me yesterday, but I have an other issue today, I put my code below, it will be easier to explain you my second issue.
void Run_MultipleAttributes (string sListOfAttributes[], int iNoOfAttributes, DB ParentDialog)
{
DB Set_MultipleAttributes_Window = create(ParentDialog, "Set Attributes")
DBE Button_Set_All
Module m = current
void Set_All_Functions (DB Run)
{
//I want to use sListOfAttributes and iNoOfAttributes here !
}
apply(Set_MultipleAttributes_Window,"Set All Attributes",Set_All_Functions)
realize(Set_MultipleAttributes_Window,200,10)
show Set_MultipleAttributes_Window
}
You can see the main function which create my second dialog box. Inside there is an other function. I would like to use sListOfAttribute and iNoOfAttribute inside on the Set_All_Functions, but it doesn't work... And I tried several things but nothing work... Thanks for your help in advance.
Best Regards, Adrien Yes; dxl really doesn't allow access to nested parent variables. In this case Set_All_Functions() cannot access variable "m" since it is neither locally nor globally defined. I suppose also sListOfAttributes is also not accessible. This makes nested functions almost useless. |
Re: Update my interface Mike.Scharnow - Mon Jan 12 05:33:41 EST 2015 Hello Adrien, I dont't think that this is possible in the way you describe it. As soon as the dialog is "realize"d, you cannot add more DBEs or change existing DBEs (like changing the text on a button). But you can use "hide" / "show" in your dialog. So, paint all DBEs on your form and "hide" those that normally should not be seen. Then, when the user clicks on a button, "show" the radiobox. You can even paint DBEs on the same spot in the dialog, just make sure that these are not 'show"n at the same time.
Best regards, Yes. The following demonstrates this idea.
-Louie |
Re: Update my interface Mike's response is the simplest and by far most common solution. And with my years of experience I will say this: if that standard solution is insufficent then I suggest you reconsider what you are trying to do. A complicated dialog means you have a complicated schema which reduces the ability of the users to understand and use it. I've never done it, but you CAN "redraw" a dialog by hiding and destroying it and then rebuilding it. You would read dialog settings into global variables and then hide then re-create. It is clumsy as the callbacks for the dialog must be declared before the function that builds the dialog, yet one of these callbacks has to call the build function. I think "forward declare" of the build-function may work as would a rediculously clever "eval_" solution; both of which IIRC have some buggy "issues". While the mechanics are solvable, deciding exactly what you want the dialog to look like in this new instance seems to me rather diffult to figure out: which elements do you WANT to show this time. Another solution that I have used is pop-up sub-dialogs. Select element "A" on the main dialog and it builds and "blocks" an "A" Subdialog, with all elements relevant to A. This became tolerable when I realized I had to summarize the details of A (from the sub-dialog) on the main dialog so the user had some clue what was going on. Lets not forget about "tab" DBEs which I found hopeless complicated to control. Had to write a few library routines just to make it manageable. -Louie There is an English Idiom for this situation: "You can have your cake and confusion too". |